package com.chennan.leading.api;

import com.chennan.leading.service.TestGenerateNo;
import com.chennan.leading.service.Testlock;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author chennan
 * @createTime 2022年03月24日 14:47:00
 */
@RestController
public class LeadingTestController {

    @Autowired
    private Testlock testlock;

    @Autowired
    private TestGenerateNo testGenerateNo;

    @GetMapping("/testDistributedLock/{lockid}")
    public String testDistributedLock(@PathVariable("lockid") Long lockid){
        testlock.testRedisLock(lockid);
        return "锁定执行完成！！！";
    }
    @GetMapping("/testDistributedLock")
    public String testGenerateNo(){
        return testGenerateNo.testGenerateNo();
    }
}
